export const fileExt = [
  {
    regExp: /^pom.xml$/,
    icon: 'vscode-icons:file-type-maven'
  },
  {
    regExp: /^Dockerfile$/,
    icon: 'vscode-icons:file-type-docker'
  },
  {
    regExp: /^vite.config.(js|ts)$/,
    icon: 'vscode-icons:file-type-vite'
  },
  {
    regExp: /^package.json$/,
    icon: 'vscode-icons:file-type-npm'
  },
  {
    regExp: /\.html$/i,
    icon: 'vscode-icons:file-type-html'
  },
  {
    regExp: /\.wxml$/i,
    icon: 'vscode-icons:file-type-wxml'
  },
  {
    regExp: /\.css/i,
    icon: 'vscode-icons:file-type-css'
  },
  {
    regExp: /\.(sass|scss)/i,
    icon: 'vscode-icons:file-type-sass'
  },

  {
    regExp: /\.less/i,
    icon: 'vscode-icons:file-type-less'
  },
  {
    regExp: /\.wxss/i,
    icon: 'vscode-icons:file-type-wxss'
  },
  {
    regExp: /\.(js|cjs)$/i,
    icon: 'vscode-icons:file-type-js'
  },
  {
    regExp: /\.(jsx|tsx)$/i,
    icon: 'vscode-icons:file-type-reactjs'
  },
  {
    regExp: /\.ts$/i,
    icon: 'vscode-icons:file-type-typescript'
  },
  {
    regExp: /\.vue$/i,
    icon: 'vscode-icons:file-type-vue'
  },
  {
    regExp: /\.md$/i,
    icon: 'vscode-icons:file-type-markdown'
  },
  {
    regExp: /\.(yaml|yml)$/i,
    icon: 'vscode-icons:file-type-light-yaml'
  },
  {
    regExp: /\.(png|jpg|jpeg|gif|webp)$/i,
    icon: 'vscode-icons:file-type-image'
  },
  {
    regExp: /\.svg$/i,
    icon: 'vscode-icons:file-type-svg'
  },
  {
    regExp: /\.ico$/i,
    icon: 'vscode-icons:file-type-favicon'
  },
  {
    regExp: /^\.git/i,
    icon: 'vscode-icons:file-type-git'
  },
  {
    regExp: /^\.env/i,
    icon: 'vscode-icons:file-type-dotenv'
  },
  {
    regExp: /^\.eslint/i,
    icon: 'vscode-icons:file-type-eslint'
  },
  {
    regExp: /^\.stylelint/i,
    icon: 'vscode-icons:file-type-stylelint'
  },
  {
    regExp: /^\.prettier/i,
    icon: 'vscode-icons:file-type-prettier'
  },
  {
    regExp: /\.json$/i,
    icon: 'vscode-icons:file-type-json'
  },
  {
    regExp: /\.(txt|csv)$/i,
    icon: 'vscode-icons:file-type-text'
  },
  {
    regExp: /\.map$/i,
    icon: 'vscode-icons:file-type-map'
  },
  {
    regExp: /\.(xls|xlsx)$/i,
    icon: 'vscode-icons:file-type-excel'
  },
  {
    regExp: /\.(doc|docx)$/i,
    icon: 'vscode-icons:file-type-word'
  },
  {
    regExp: /\.(ppt|pptx)$/i,
    icon: 'vscode-icons:file-type-powerpoint'
  },
  {
    regExp: /\.pdf$/i,
    icon: 'vscode-icons:file-type-pdf2'
  },
  {
    regExp: /\.(sh|bash)$/i,
    icon: 'vscode-icons:file-type-shell'
  },
  {
    regExp: /\.bat$/i,
    icon: 'vscode-icons:file-type-bat'
  },
  {
    regExp: /\.log$/i,
    icon: 'vscode-icons:file-type-log'
  },
  {
    regExp: /\.sql$/i,
    icon: 'vscode-icons:file-type-sql'
  },
  {
    regExp: /\.(zip|rar|7z|tar|gz|bz2|bz)$/i,
    icon: 'vscode-icons:file-type-zip'
  },
  {
    regExp: /\.jar$/i,
    icon: 'vscode-icons:file-type-jar'
  },
  {
    regExp: /\.java$/i,
    icon: 'vscode-icons:file-type-java'
  },
  {
    regExp: /\.xml$/i,
    icon: 'vscode-icons:file-type-xml'
  },
  {
    regExp: /\.ini$/i,
    icon: 'vscode-icons:file-type-ini'
  },
  {
    regExp: /\.conf$/i,
    icon: 'vscode-icons:file-type-config'
  },
  {
    regExp: /\.ttf$/i,
    icon: 'vscode-icons:file-type-font'
  },
  {
    regExp: /\.(crt|cer)$/i,
    icon: 'vscode-icons:file-type-cert'
  },
  {
    regExp: /\.(pem|key)$/i,
    icon: 'vscode-icons:file-type-key'
  },
  {
    regExp: /\.(mp3|wav)$/i,
    icon: 'vscode-icons:file-type-audio'
  },
  {
    regExp: /\.(pm4|avi)$/i,
    icon: 'vscode-icons:file-type-video'
  },
  {
    regExp: /\.dart$/i,
    icon: 'vscode-icons:file-type-dartlang'
  },
  {
    regExp: /\.py$/i,
    icon: 'vscode-icons:file-type-python'
  },
  {
    regExp: /\.cpp$/i,
    icon: 'vscode-icons:file-type-cpp'
  },
  {
    regExp: /./,
    icon: 'vscode-icons:default-file'
  }
  
]

export function getIcon(file){
  for (let i = 0; i < fileExt.length; i++) {
    if (file.match(fileExt[i].regExp)) {
      return fileExt[i].icon
    }
  }
}